package com.example.androidlove;

import br.com.exemplo.db.dao.ClientesDao;
import br.com.exemplo.db.entities.Clientes;
import android.os.Build;
import android.os.Bundle;
import android.annotation.TargetApi;
import android.app.Activity;
import android.app.ProgressDialog;
import android.database.sqlite.SQLiteDatabase;
import android.view.Menu;
import android.view.View;
import android.widget.TextView;

@TargetApi(Build.VERSION_CODES.ICE_CREAM_SANDWICH)
public class MainActivity extends Activity {
	
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_main);
		new DataBaseHelper(getApplicationContext());
	}

	@Override
	public boolean onCreateOptionsMenu(Menu menu) {
		// Inflate the menu; this adds items to the action bar if it is present.
		getMenuInflater().inflate(R.menu.main, menu);
		return true;
	}
	
	public void onLoveButtonClicked(View view){
		TextView myText = (TextView) findViewById(R.id.textView1);
		if (myText.getVisibility() == TextView.VISIBLE)
			myText.setVisibility(TextView.INVISIBLE);
		else
		if (myText.getVisibility() == TextView.INVISIBLE){
			myText.setVisibility(TextView.VISIBLE);
		}
		
		ClientesDao dao = new ClientesDao(getApplicationContext());
	     Clientes cliente = new Clientes();
	     cliente.setEmail("strangerdroid@gmail.com");
	     cliente.setNome("Stranger");
	     cliente.setSobrenome("Droid");
	     dao.insert(cliente);		
	}

}
